package com.jic.veteran.portal.controller;

import com.google.common.collect.Maps;
import com.jic.veteran.common.api.CommonResult;
import com.jic.veteran.model.AlumniExplain;
import com.jic.veteran.model.AlumniInstructions;
import com.jic.veteran.model.AlumniRule;
import com.jic.veteran.portal.service.AlumniExplainService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 获取校友会介绍、规章、使用说明
 * @author mars
 * @date 2021/11/10
 */
@RestController
@Api(tags = "AlumniExplainController",description = "校友会简介、章程、使用说明")
@RequestMapping("/alumniexplain")
public class AlumniExplainController {
  @Autowired
  private AlumniExplainService alumniExplainService;

  @ApiOperation("查询校友会介绍")
  @RequestMapping(value = "/explain", method = RequestMethod.GET)
  public CommonResult<AlumniExplain> getExplain() {
    AlumniExplain alumniExplain = alumniExplainService.getExplain();
    return CommonResult.success(alumniExplain);
  }

  @ApiOperation("校友会规章")
  @RequestMapping(value = "/rule", method = RequestMethod.GET)
  @ResponseBody
  public CommonResult<AlumniRule> getRule() {
    AlumniRule alumniRule = alumniExplainService.getRule();
    return CommonResult.success(alumniRule);
  }


  @ApiOperation("校友会使用说明")
  @RequestMapping(value = "/alumniinstructions", method = RequestMethod.GET)
  @ResponseBody
  public CommonResult<AlumniInstructions> getAlumniInstructions() {
    AlumniInstructions alumniInstructions = alumniExplainService.getAlumniInstructions();
    return CommonResult.success(alumniInstructions);
  }

}
